package org.luxor.commons.rabbitmq.service.pushmessage;

import org.luxor.commons.rabbitmq.annotation.PushMessage;
import org.luxor.commons.rabbitmq.context.MessageContext;
import org.luxor.commons.rabbitmq.definition.MessageDefinition;
import org.springframework.stereotype.Service;

/**
 * @author Mr.Yan  @date 2019/10/18$
 */
@Service
public class UserChangeEventSender {

    @PushMessage
    public void sendUserChangeEvent(UserChangeEvent event) {
        MessageDefinition message = new MessageDefinition("exchange.topic.user", "user.chang", event);
        MessageContext.push(message);
    }
}
